package com.skyward.android.androiddemo2;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.skyward.android.androiddemo2.adapter.BrokenLineAdapter;
import com.skyward.android.androiddemo2.bean.FifteenBean;

import java.util.ArrayList;
import java.util.List;

public class BrokenLineActivity extends AppCompatActivity {
    private List<FifteenBean> mList = new ArrayList<>();
    private RecyclerView recycle;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_broken_line);
        recycle = (RecyclerView) findViewById(R.id.recycle);
        mList.add(new FifteenBean(24,18));
        mList.add(new FifteenBean(24,19));
        mList.add(new FifteenBean(25,20));
        mList.add(new FifteenBean(24,19));
        mList.add(new FifteenBean(25,18));
        mList.add(new FifteenBean(26,20));
        mList.add(new FifteenBean(27,21));
        mList.add(new FifteenBean(29,22));
        mList.add(new FifteenBean(28,22));
        mList.add(new FifteenBean(29,22));
        mList.add(new FifteenBean(30,22));
        mList.add(new FifteenBean(31,23));
        mList.add(new FifteenBean(30,20));
        mList.add(new FifteenBean(25,20));
        mList.add(new FifteenBean(28,21));

        LinearLayoutManager manager = new LinearLayoutManager(this);
        manager.setOrientation(LinearLayoutManager.HORIZONTAL);
        BrokenLineAdapter adapter = new BrokenLineAdapter(R.layout.fifteen_line_item,mList);
        recycle.setLayoutManager(manager);
        recycle.setAdapter(adapter);

    }
}
